import { Column, Entity, OneToOne, PrimaryGeneratedColumn } from "typeorm";
import { TeacherTitleEnum } from "src/enums/school/teacher.enum";
import { Teacher } from "./teacher.entity";

@Entity()
export class TeacherDetail {
  //自增列
  @PrimaryGeneratedColumn()
  teacherId: number;

  @Column({ comment: "教师职称", type: "enum", enum: Object.keys(TeacherTitleEnum) })
  teacherTitle: keyof typeof TeacherTitleEnum;

  @Column({ comment: "性别 1-男 2-女 3-未知", type: "enum", enum: [1, 2, 3] })
  gender: 1 | 2 | 3;

  @Column({ comment: "教师简介", type: "text" })
  teacherProfile: string;

  @Column({ comment: "联系电话" })
  teacherPhone: string;

  @Column({ comment: "教师照片", default: null })
  teacherPhoto: string;

  @Column({ comment: "现居地址" })
  currentAddress: string;

  @Column({ comment: "身份证号码" })
  idCard: string;

  @Column({ comment: "身份证地址" })
  idCardAddress: string;

  @Column({ comment: "生日" })
  birthday: string;

  @OneToOne(() => Teacher, teacher => teacher.detail)
  teacher: Teacher;
}
